package lv.rtu.ditf.dc.keyvalue;

import java.util.Comparator;

/**
 * 
 * @author Pāvels Koliškins, Edgars Matisāns
 *
 */
public class CategorizationClassPointComparator implements Comparator<CategorizationClassPointKeyValue> {
    
    @Override
    public int compare(CategorizationClassPointKeyValue cat1, 
            CategorizationClassPointKeyValue cat2) {

        double rank1 = cat1.getDistancePoint();
        double rank2 = cat2.getDistancePoint();

        if (rank1 < rank2){
            return +1;
        }else if (rank1 > rank2){
            return -1;
        }else{
            return 0;
        }
    }
}
